package com.me.study.app.adapater

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.me.study.R
import com.me.study.app.data.EmojiBean

/**
 *create author : FZW
 *create date  : 2024/12/26
 */
class EmojiAdapter(list: MutableList<EmojiBean>) :
    BaseQuickAdapter<EmojiBean, BaseViewHolder>(R.layout.item_emoji, list) {

    override fun convert(holder: BaseViewHolder, item: EmojiBean) {
        val code16 = item.code.substring(2)
        val hex = Integer.parseInt(code16, 16)
        val chars = Character.toChars(hex)
        holder.setText(R.id.tv_emoji, String(chars))
    }
}